﻿<local:DocumentBase x:Class="WPFExcelReport.SDTVKVV"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock" 
                    xmlns:dat="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:exc="clr-namespace:IntexReportStudio.UserControls"
                    Loaded="Window_Loaded" 
                    FontSize="16" 
                    Background="White"  
                    HorizontalAlignment="Stretch"
                    Margin="0,0,0,0" 
                    VerticalAlignment="Stretch"
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="Set4ITX" />
        <db:SETINTEXDB  x:Key="SetVITX" />
        <CollectionViewSource   x:Key="vwVKKOPF" Source="{Binding Path=VKKOPF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVKPOS" Source="{Binding Path=VKPOS,Source={StaticResource SetData}}" />
        <CollectionViewSource  x:Key="vwKDSTAMM" Source="{Binding Path=KDSTAMM,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVAART" Source="{Binding Path=VAART,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVAFARBEN" Source="{Binding Path=VAFARBEN,Source={StaticResource SetData}}" />
        <CollectionViewSource  x:Key="vwWBBST" Source="{Binding Path=WBBST,Source={StaticResource SetData}}" />
        <CollectionViewSource  x:Key="vwWBBST_ITX" Source="{Binding Path=WBBST_ITX,Source={StaticResource SetData}}" />
        <CollectionViewSource  x:Key="vwVVTLIEF" Source="{Binding Path=VVTLIEF,Source={StaticResource SetData}}" />
        <CollectionViewSource  x:Key="vwKUNDVER" Source="{Binding Path=KUNDVER,Source={StaticResource SetData}}" />
        <CollectionViewSource  x:Key="vwINTEX" Source="{Binding Path=INTEX_MAP,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="nwVKKOPF" Source="{Binding Path=VKKOPF,Source={StaticResource Set4ITX}}" />
        <CollectionViewSource   x:Key="nwVKPOS" Source="{Binding Path=VKPOS,Source={StaticResource Set4ITX}}" />
        <CollectionViewSource   x:Key="nwVVLIEF" Source="{Binding Path=VVLIEF,Source={StaticResource Set4ITX}}" />
        <CollectionViewSource   x:Key="nvVKKOPF" Source="{Binding Path=VKKOPF,Source={StaticResource SetVITX}}" />
        <CollectionViewSource   x:Key="nvVVLIEF" Source="{Binding Path=VVLIEF,Source={StaticResource SetVITX}}" />
    </local:DocumentBase.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="250"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Column="0">
            <Expander Name="expLog" ExpandDirection="Left" IsExpanded="True" Visibility="Hidden">
                <WrapPanel Name="zoneCommand" Height="34" Margin="0,0,0,6">
                    <Label   Content="系统" Width="Auto" Margin="0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                    <TextBox   Name="txtMANDANT" MaxLength="2" Width="40" Margin="10,0,0,0" Text="00" HorizontalAlignment="Left" Background="Pink" FontSize="18" />
                    <Label  Content="语言" Width="Auto" Margin="0,0,0,0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                    <TextBox   IsReadOnly="True" Name="txtSPRACHKZ" Width="40" Margin="0,0,0,0" Text="" MaxLength="1" HorizontalAlignment="Left" Background="Pink" FontSize="18" />
                    <Label  Content="用户名" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                    <TextBox  Name="txtUserID" Width="80" Margin="10,0,0,0" Text="" HorizontalAlignment="Left" Background="Yellow" FontSize="18" MaxLength="8" AcceptsTab="True" CharacterCasing="Upper" KeyboardNavigation.TabIndex="0" />
                    <Label Content="密码" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                    <PasswordBox  Name="txtPassword" Width="80" Margin="10,0,0,0" HorizontalAlignment="Left" Background="Yellow" FontSize="18" KeyboardNavigation.TabIndex="1" />
                    <Button  Height="Auto" Margin="10,0,0,0" Name="btnLogIn" Width="34" Click="btnLogIn_Click" KeyboardNavigation.TabIndex="2" IsDefault="True">
                        <Button.Background>
                            <ImageBrush  ImageSource="/IntexReportClient;component/Images/User.png" />
                        </Button.Background>
                    </Button>
                    <Button  Height="Auto" Margin="10,0,0,0" Name="btnReloadCon" Width="34" Click="btnReloadCon_Click" KeyboardNavigation.TabIndex="2" IsDefault="True">
                        <Button.Background>
                            <ImageBrush  ImageSource="/IntexReportClient;component/Images/Compact Disk.png" />
                        </Button.Background>
                    </Button>
                    <Button  Height="Auto" Margin="10,0,0,0" Name="btnResetSetDispo" Width="Auto" Click="btnResetSetDispo_Click" KeyboardNavigation.TabIndex="2" IsDefault="True">
                        重置参数
                    </Button>
                    <TextBlock  Name="txtLogIn" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left" Background="White" FontSize="14" KeyboardNavigation.TabIndex="1" />
                </WrapPanel>
            </Expander>
            <StackPanel>
                <Grid Height="448">
                    <Grid.RowDefinitions>
                        <RowDefinition   Height="Auto" MaxHeight="300"/>
                        <RowDefinition   Height="Auto" MaxHeight="300"/>
                        <RowDefinition   Height="Auto"  MaxHeight="300"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition  Width="1*" />
                        <ColumnDefinition  Width="1*" />
                        <ColumnDefinition  Width="1*" />
                        <ColumnDefinition  Width="1*" />
                        <ColumnDefinition Width="1*" />
                        <ColumnDefinition Width="1*" />
                        <ColumnDefinition Width="1*" />
                        <ColumnDefinition Width="1*" />
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="6">
                        <WrapPanel >
                            <Button Name="butExcelLoad" Width="40" Height="40" HorizontalAlignment="Left" Click="butExcelLoad_Click">
                                <Button.Background>
                                    <ImageBrush  ImageSource="/IntexReportClient;component/Images/excel_icon_1.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock VerticalAlignment="Center">通过EXCEL载入</TextBlock>
                            <WrapPanel  VerticalAlignment="Center">
                                <TextBlock  Margin="10,0,0,0" Width="Auto" Height="30" VerticalAlignment="Center">总价:</TextBlock>
                                <TextBox  Name="txtValue" Text="0        " Background="#17000000" Height="30" Width="Auto" VerticalAlignment="Center"/>
                                <TextBlock  Margin="10,0,0,0" Width="Auto" Height="30" VerticalAlignment="Center">个数:</TextBlock>
                                <TextBox  Name="txtPos" Text="0 " Background="#17000000" Height="30" Width="Auto" VerticalAlignment="Center"/>
                                <TextBlock  Margin="10,0,0,0" Width="Auto" Height="30" VerticalAlignment="Center">单位:</TextBlock>
                                <TextBox  Name="txtMEEH" Text="M  " Background="#17000000" Height="30" Width="Auto" VerticalAlignment="Center"/>
                                <TextBlock  Margin="2,0,0,0" Width="Auto" Height="30">交期:</TextBlock>
                                <TextBox   Text="{Binding Path=VKPLIEFTERM, Source={StaticResource ResourceKey=vwVKPOS}, Mode=TwoWay}" Background="#17000000" Height="30" Width="93"/>
                            </WrapPanel>
                        </WrapPanel>                     
                        <WrapPanel >
                            <WrapPanel  VerticalAlignment="Center">
                                <Button Name="btnAddNewOrder" Click="btnAddNewOrder_Click" Height="40" Width="40">
                                    <Button.Background>
                                        <ImageBrush  ImageSource="/IntexReportClient;component/Images/Add.png" />
                                    </Button.Background>
                                </Button>
                                <TextBlock  Margin="10,0,0,0" Width="Auto" Height="30" VerticalAlignment="Center">新建销售单</TextBlock>
                                <Label   Content="客户:" Width="Auto" Margin="20,0,0,0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                                <ComboBox Name="cbKDKUNDNA"
                                  IsEditable="True"
                                  IsTextSearchEnabled="True"
                                  IsTextSearchCaseSensitive="False"
                                  Width="120"
                                  DisplayMemberPath="KDKUNDNA"
                                  SelectedValuePath="KDKUNDNR"
                                      SelectionChanged="cbKDKUNDNA_SelectionChanged"
                                  ItemsSource="{Binding Source={StaticResource ResourceKey=vwKDSTAMM}}"
                                  >
                                </ComboBox>
                                <ComboBox Name="cbKDKUNDNR"
                                  IsEditable="True"
                                  IsTextSearchEnabled="True"
                                  IsTextSearchCaseSensitive="False"
                                  Width="120"
                                  DisplayMemberPath="KDKUNDNR"
                                  SelectedValuePath="KDKUNDNR"
                                  SelectionChanged="cbKDKUNDNA_SelectionChanged"
                                  ItemsSource="{Binding Source={StaticResource ResourceKey=vwKDSTAMM}}"
                                  >
                                </ComboBox>
                                <ComboBox Name="cbKUNDVER"
                                  IsEditable="True"
                                  IsTextSearchEnabled="True"
                                  IsTextSearchCaseSensitive="False"
                                  Width="60"
                                      Text="SD "
                                  DisplayMemberPath="KDVVB"
                                  SelectedValuePath="KDVVB"
                                  ItemsSource="{Binding Source={StaticResource ResourceKey=vwKUNDVER}}"
                                  >
                                </ComboBox>
                                <TextBlock Width="Auto" VerticalAlignment="Center">系列</TextBlock>
                                <TextBox Name="txtKOLL" Width="Auto" MinWidth="40" VerticalAlignment="Center">CU</TextBox>
                                <TextBlock Width="Auto" VerticalAlignment="Center">仓库</TextBlock>
                                <TextBox Name="txtWBLO" Width="Auto" MinWidth="20" Background="Yellow" VerticalAlignment="Center">02</TextBox>
                                <TextBox Name="txtWBLB" Width="Auto" MinWidth="20"  Background="AliceBlue" VerticalAlignment="Center">2F</TextBox>
                            </WrapPanel >                     
                            <Button Name="btnAutoRun" Click="btnAutoRun_Click" Margin="30,0,0,0" Height="40" Width="40" Content="自动" Visibility="Hidden">
                                <Button.Background>
                                    <ImageBrush  ImageSource="/IntexReportClient;component/Images/Reload.png" />
                                </Button.Background>
                            </Button>
                            <TextBox Name="IsRun"  TextChanged="IsRun_TextChanged" Visibility="Hidden">Y</TextBox>
                            <Button Name="btnStopRun" Click="btnStopRun_Click" Margin="30,0,0,0" Height="40" Width="40" Content="停止" Visibility="Hidden">
                                <Button.Background>
                                    <ImageBrush  ImageSource="/IntexReportClient;component/Images/Delete.png" />
                                </Button.Background>
                            </Button>
                        </WrapPanel >

                    </StackPanel>
                    <StackPanel  Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" Height="349" Margin="0,0,0,0" Grid.RowSpan="2">
                        <WrapPanel HorizontalAlignment="Left">
                            <Button Name="btnAddNewOrderLine" Click="btnAddNewOrderLine_Click" Height="40" Width="40">
                                <Button.Background>
                                    <ImageBrush  ImageSource="/IntexReportClient;component/Images/Add.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock  Margin="10,0,0,0" Width="Auto" Height="30">增加行</TextBlock>
                            <TextBlock  Margin="10,0,0,0" Width="Auto" Height="30">长度:</TextBlock>
                            <TextBox   Text="{Binding Path=VKPMENGE1, Source={StaticResource ResourceKey=vwVKPOS}, Mode=TwoWay, Converter={StaticResource d100}}" Background="#17000000" Height="30" Width="53"/>
                            <TextBlock  Margin="2,0,0,0" Width="Auto" Height="30">价格:</TextBlock>
                            <TextBox   Text="{Binding Path=VKPPREIS, Source={StaticResource ResourceKey=vwVKPOS}, Mode=TwoWay, Converter={StaticResource PreisConverter}}" Background="#17000000" Height="30" Width="53"/>
                        </WrapPanel>
                        <DataGrid  x:Name="dlgVKPOS"
                       ItemsSource="{Binding Source={StaticResource ResourceKey=vwVKPOS}}"  
                       AutoGenerateColumns="False" EnableRowVirtualization="True"
                       VerticalScrollBarVisibility="Auto"
                       HorizontalScrollBarVisibility="Auto"
                        MaxHeight="300"
                       VerticalAlignment="Stretch"
                       HeadersVisibility="Column" 
                       FontSize="16"
                       HorizontalAlignment="Stretch"
                       SelectionChanged="dlgVKPOS_SelectionChanged"    
                        EnableColumnVirtualization="True">
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding Path=VKPAUFPOS}" Header="行" Width="Auto" MinWidth="40" />
                                <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="品种" Width="Auto" MinWidth="100" />
                                <DataGridTextColumn Binding="{Binding Path=VKPFARBE}" Header="颜色" Width="Auto" MinWidth="60" />
                                <DataGridTextColumn Binding="{Binding Path=VKPMENGE1, Converter={StaticResource ResourceKey=d100}}" Header="长度" Width="Auto" MinWidth="40" />
                                <DataGridTextColumn Binding="{Binding Path=VKPPREIS, Converter={StaticResource ResourceKey=d1000}}" Header="价格" Width="Auto" MinWidth="40" />
                            </DataGrid.Columns>
                        </DataGrid>
                    </StackPanel>
                    <Grid Grid.Row="1"  Grid.Column="4" Grid.ColumnSpan="4" Height="349" Margin="0,0,0,0" Grid.RowSpan="2">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"></RowDefinition>
                            <RowDefinition Height="1*" ></RowDefinition>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1*"></ColumnDefinition>
                            <ColumnDefinition Width="1*"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <StackPanel Orientation="Horizontal"  Grid.Row="0"  Grid.Column="0" Grid.ColumnSpan="2">
                            <Button Name="btnGetVAART" Height="40" Width="40" Click="btnGetVAART_Click">
                                <Button.Background>
                                    <ImageBrush  ImageSource="/IntexReportClient;component/Images/Search.png" />
                                </Button.Background>
                            </Button>
                            <ComboBox
                            Name="cbVAART"
                              HorizontalAlignment="Left"
                              IsEditable="True"
                              IsTextSearchEnabled="True"
                              IsTextSearchCaseSensitive="False"
                              SelectionChanged="cbVAART_SelecteionChanged"
                              Width="200"
                              DisplayMemberPath="VAAART"
                              SelectedValuePath="VAAART"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwVAART}}"
                              >
                            </ComboBox>
                            <TextBlock Text="{Binding VAABEZ, Source={StaticResource ResourceKey=vwVAART}, Converter={StaticResource ResourceKey=gb2312}}"></TextBlock>
                            <Button Name="btnSaveWork" Click="btnSaveWork_Click" Margin="50,0,0,0" Height="40" Width="40">
                                <Button.Background>
                                    <ImageBrush  ImageSource="/IntexReportClient;component/Images/Upload.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock>保存并上传</TextBlock>
                        </StackPanel>
                        <DataGrid Grid.Row="1" x:Name="listVAFARBEN"
                                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwVAFARBEN}}"  
                                   AutoGenerateColumns="False" 
                                   VerticalScrollBarVisibility="Auto"
                                   HorizontalScrollBarVisibility="Auto"
                                   HeadersVisibility="Column" 
                                  Grid.Column="0"  
                                  Grid.ColumnSpan="2"
                                  SelectionChanged="listVAFARBEN_SelecteionChanged"
                                  FontSize="18"
                                  MinHeight="300"
                                  MaxHeight="600" 
                                  HorizontalAlignment="Stretch"
                                  VerticalAlignment="Stretch" 
                                  EnableColumnVirtualization="False" Height="300"  Margin="0,4,0,4">
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding VAFFARBE, Converter={StaticResource gb2312}}" Header="色号" Width="Auto" MinWidth="80" />
                                <DataGridTextColumn Binding="{Binding VAFBEZ, Converter={StaticResource gb2312}}" Header="描述" Width="Auto" MinWidth="120" />
                                <DataGridTextColumn Binding="{Binding VAFFILLER}" Header="库存" Width="Auto" MinWidth="80" />
                            </DataGrid.Columns>
                        </DataGrid>
                        <!--DataGrid  Grid.Row="1"  Grid.Column="2"  
                            x:Name="dlgWBBST"
                                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwWBBST}}"  
                                   AutoGenerateColumns="False" 
                                   VerticalScrollBarVisibility="Auto"
                                   HorizontalScrollBarVisibility="Auto"
                                   HeadersVisibility="Column" 
                                   FontSize="12"
                                MinHeight="300"
                                   MaxHeight="400"
                                   HorizontalAlignment="Stretch"
                                   VerticalAlignment="Top"                
                           EnableColumnVirtualization="False">
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding Path=WBBLP}" Header="库位" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=WBBSTKNR}" Header="布卷号" Width="Auto" MinWidth="100" />
                            <DataGridTextColumn Binding="{Binding Path=WBBISTKLG, Converter={StaticResource d1000}}" Header="长度" Width="Auto" MinWidth="80" />
                            </DataGrid.Columns>
                        </DataGrid-->
                    </Grid>

                </Grid>
            </StackPanel>
        </StackPanel>
        <Expander  Grid.Column="1" ExpandDirection="Right" MaxHeight="800" IsExpanded="True"> 
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40"></RowDefinition>
                        <RowDefinition Height="200"></RowDefinition>
                        <RowDefinition Height="1*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <WrapPanel Grid.Row="0" Grid.Column="0">
                        <Label    Content="单号: " Width="Auto" Margin="0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                        <TextBlock  Name="txtVKKAUFKRS"  Text="SC" Width="Auto" Margin="0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                    </WrapPanel>
                    
                    <Label  Grid.Row="0" Grid.Column="1"  Content="发货单:" Width="Auto" Margin="0" HorizontalAlignment="Left" FontSize="18" VerticalAlignment="Center" />
                    <StackPanel  Grid.Row="1" Grid.Column="0">
                        <TextBlock Name="listVKFLFD"></TextBlock>
                    <!--DataGrid  
                        Grid.Row="1" Grid.Column="0"
                       ItemsSource="{Binding Source={StaticResource ResourceKey=nvVKKOPF}}"  
                       AutoGenerateColumns="False" EnableRowVirtualization="True"
                       VerticalScrollBarVisibility="Auto"
                       HorizontalScrollBarVisibility="Auto"
                        MaxHeight="300"
                       VerticalAlignment="Stretch"
                       HeadersVisibility="Column" 
                       FontSize="16"
                       HorizontalAlignment="Stretch"
                        >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=VKKAUFLFD}" Header="" Width="Auto" MinWidth="80" />                            
                        </DataGrid.Columns>
                    </DataGrid-->
                    </StackPanel>
                    <StackPanel  Grid.Row="1" Grid.Column="1">
                        <TextBlock Name="listVVFLFD"></TextBlock>
                    <!--DataGrid                 
                       ItemsSource="{Binding Source={StaticResource ResourceKey=nvVVLIEF}}"  
                       AutoGenerateColumns="False" EnableRowVirtualization="True"
                       VerticalScrollBarVisibility="Auto"
                       HorizontalScrollBarVisibility="Auto"
                        MaxHeight="300"
                       VerticalAlignment="Stretch"
                       HeadersVisibility="Column" 
                       FontSize="16"
                       HorizontalAlignment="Stretch"
                        >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=VVLIEFSCH}" Header="" Width="Auto" MinWidth="80" />
                        </DataGrid.Columns>
                    </DataGrid-->
                    </StackPanel>
                    <exc:EventLog   Grid.Row="2" Grid.Column="0"  Grid.ColumnSpan="2"
                                    MaxHeight="300"
                              x:Name="_LogExplorerDock" />
                </Grid>
           
        </Expander>
    </Grid>    
</local:DocumentBase>